From 89e4455a590a1c901250d391aa4eedfd67fef04a Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Fri, 20 Jul 2007 11:36:36 +0100 Subject: [PATCH] [XEN] replace shadow_* with paging_* in common code Signed-off-by: Tim Deegan --- xen/common/compat/kernel.c | 1 - xen/common/domctl.c | 1 - xen/common/grant_table.c | 1 - xen/common/kernel.c | 4 ++-- xen/common/keyhandler.c | 1 - xen/common/memory.c | 8 ++++---- xen/common/page_alloc.c | 2 +- xen/common/xenoprof.c | 6 +++--- xen/include/asm-x86/config.h | 2 +- xen/include/xen/paging.h | 26 ++++++++++++++++++++++++++ xen/include/xen/shadow.h | 23 ----------------------- 11 files changed, 37 insertions(+), 38 deletions(-) create mode 100644 xen/include/xen/paging.h delete mode 100644 xen/include/xen/shadow.h diff --git a/xen/common/compat/kernel.c b/xen/common/compat/kernel.c index a655c9c227..f3285fd14f 100644 --- a/xen/common/compat/kernel.c +++ b/xen/common/compat/kernel.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 91020dfa81..db7d55d9be 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 74db8daff5..8df6fb1cc1 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 0e675d3c4b..117690461f 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -217,7 +217,7 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg) fi.submap = 0; if ( VM_ASSIST(d, VMASST_TYPE_pae_extended_cr3) ) fi.submap |= (1U << XENFEAT_pae_pgdir_above_4gb); - if ( shadow_mode_translate(current->domain) ) + if ( paging_mode_translate(current->domain) ) fi.submap |= (1U << XENFEAT_writable_page_tables) | (1U << XENFEAT_auto_translated_physmap); diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 00f9afac0f..e6e4d296ab 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #define KEY_MAX 256 diff --git a/xen/common/memory.c b/xen/common/memory.c index 8fe4523582..311c5ae123 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -127,7 +127,7 @@ static void populate_physmap(struct memop_args *a) mfn = page_to_mfn(page); - if ( unlikely(shadow_mode_translate(d)) ) + if ( unlikely(paging_mode_translate(d)) ) { for ( j = 0; j < (1 << a->extent_order); j++ ) guest_physmap_add_page(d, gpfn + j, mfn + j); @@ -236,7 +236,7 @@ static long translate_gpfn_list( if ( (d = rcu_lock_domain_by_id(op.domid)) == NULL ) return -ESRCH; - if ( !shadow_mode_translate(d) ) + if ( !paging_mode_translate(d) ) { rcu_unlock_domain(d); return -EINVAL; @@ -434,7 +434,7 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg) &gpfn, exch.out.extent_start, (i< #include #include -#include #include #include #include #include #include #include +#include /* * Comma-separated list of hexadecimal page numbers containing bad bytes. diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c index 9212156f02..e25ad7bb30 100644 --- a/xen/common/xenoprof.c +++ b/xen/common/xenoprof.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include /* Limit amount of pages used for shared buffer (per domain) */ #define MAX_OPROF_SHARED_PAGES 32 @@ -397,7 +397,7 @@ static int add_passive_list(XEN_GUEST_HANDLE(void) arg) d->xenoprof->domain_type = XENOPROF_DOMAIN_PASSIVE; passive.nbuf = d->xenoprof->nbuf; passive.bufsize = d->xenoprof->bufsize; - if ( !shadow_mode_translate(current->domain) ) + if ( !paging_mode_translate(current->domain) ) passive.buf_gmaddr = __pa(d->xenoprof->rawbuf); else xenoprof_shared_gmfn_with_guest( @@ -598,7 +598,7 @@ static int xenoprof_op_get_buffer(XEN_GUEST_HANDLE(void) arg) xenoprof_get_buffer.nbuf = d->xenoprof->nbuf; xenoprof_get_buffer.bufsize = d->xenoprof->bufsize; - if ( !shadow_mode_translate(d) ) + if ( !paging_mode_translate(d) ) xenoprof_get_buffer.buf_gmaddr = __pa(d->xenoprof->rawbuf); else xenoprof_shared_gmfn_with_guest( diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 25ade56c00..a9bfc7076e 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -17,7 +17,7 @@ #define CONFIG_X86 1 #define CONFIG_X86_HT 1 -#define CONFIG_SHADOW 1 +#define CONFIG_PAGING_ASSISTANCE 1 #define CONFIG_SMP 1 #define CONFIG_X86_LOCAL_APIC 1 #define CONFIG_X86_GOOD_APIC 1 diff --git a/xen/include/xen/paging.h b/xen/include/xen/paging.h new file mode 100644 index 0000000000..54ab4add84 --- /dev/null +++ b/xen/include/xen/paging.h @@ -0,0 +1,26 @@ + +#ifndef __XEN_PAGING_H__ +#define __XEN_PAGING_H__ + +#include + +#if defined CONFIG_PAGING_ASSISTANCE + +#include +#include + +#elif defined CONFIG_SHADOW + +#include + +#define paging_mode_translate(d) shadow_mode_translate(d) + +#else + +#define paging_mode_translate(d) (0) +#define guest_physmap_add_page(d, p, m) ((void)0) +#define guest_physmap_remove_page(d, p, m) ((void)0) + +#endif + +#endif /* __XEN_PAGING_H__ */ diff --git a/xen/include/xen/shadow.h b/xen/include/xen/shadow.h deleted file mode 100644 index 7f457421b8..0000000000 --- a/xen/include/xen/shadow.h +++ /dev/null @@ -1,23 +0,0 @@ - -#ifndef __XEN_SHADOW_H__ -#define __XEN_SHADOW_H__ - -#include - -#ifdef CONFIG_SHADOW - -#include - -#else - -#define shadow_drop_references(d, p) ((void)0) -#define shadow_sync_and_drop_references(d, p) ((void)0) - -#define shadow_mode_translate(d) (0) - -#define guest_physmap_add_page(d, p, m) ((void)0) -#define guest_physmap_remove_page(d, p, m) ((void)0) - -#endif - -#endif /* __XEN_SHADOW_H__ */ -- 2.30.2